<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCruiseTemplatePositionProjectMappingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cruise_template_position_project_mappings', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('templateId')->default(0)->comment('巡店模板id');
            $table->unsignedInteger('positionId')->default(0)->comment('巡店模板位置id');
            $table->unsignedInteger('projectId')->default(0)->comment('巡店项目id');
            $table->unsignedInteger('relationProjectId')->default(0)->comment('关联项目id');
            $table->string('relationOptions', 128)->default('')->comment('关联项目的选项value json');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '巡店 - 巡店模板位置关联项目';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cruise_template_position_project_mappings');
    }
}
